Skip to content

feat: ic0 v1.1.0 and ic-cdk v0.20.1 with msg_caller_info_{data,signer} APIs#708

Merged
lwshang merged 10 commits intomainfrom
lwshang/SDK-2672_identity_attributes
Apr 20, 2026
Merged

feat: ic0 v1.1.0 and ic-cdk v0.20.1 with msg_caller_info_{data,signer} APIs#708
lwshang merged 10 commits intomainfrom
lwshang/SDK-2672_identity_attributes

Conversation

@lwshang
Copy link
Copy Markdown
Contributor

@lwshang lwshang commented Apr 16, 2026

Summary

  • Add msg_caller_info_data_size/copy and msg_caller_info_signer_size/copy raw bindings to ic0 (sys.rs and lib.rs)
  • Add msg_caller_info_data() -> Vec<u8> and msg_caller_info_signer() -> Option<Principal> higher-level bindings to ic_cdk::api
  • Add e2e tests using PocketIC's update_call_with_sender_info

These APIs expose the caller identity attribute feature described in dfinity/portal#6202. msg_caller_info_data returns auxiliary data provided by the signing canister, and msg_caller_info_signer returns the canister ID of the canister that provided the caller's canister signature. Both return empty/None when the caller is not authenticated via canister signatures.

PocketIC setup improvements

The e2e test harness/CI now supports pinning pocket-ic to a git revision in addition to a tag, and the download step resolves the matching server binary for either form. This unblocked developing against an unreleased RC of PocketIC before cutting over to the tagged release.

Crate releases

  • ic0 1.0.1 → 1.1.0
  • ic-cdk 0.20.0 → 0.20.1 (and ic-cdk-macros bumped in lockstep)

Test plan

  • E2e tests pass: call_msg_caller_info_data and call_msg_caller_info_signer verify correct values with and without sender_info

🤖 Generated with Claude Code

lwshang and others added 7 commits April 16, 2026 10:47
…d downloads

Switch pocket-ic dependency from a git tag to a specific commit rev
(2026-04-15, IC PR #9845) and update the download script and test
utilities to handle both `rev=` and `tag=` source URLs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e,copy}

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread e2e-tests/tests/api.rs
lwshang and others added 3 commits April 20, 2026 09:53
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lwshang lwshang changed the title feat: add msg_caller_info_{data,signer} system API bindings feat: prepare ic0 v1.1.0 and ic-cdk v0.20.1 releases with msg_caller_info_{data,signer} APIs Apr 20, 2026
@lwshang lwshang changed the title feat: prepare ic0 v1.1.0 and ic-cdk v0.20.1 releases with msg_caller_info_{data,signer} APIs feat: ic0 v1.1.0 and ic-cdk v0.20.1 with msg_caller_info_{data,signer} APIs Apr 20, 2026
@lwshang lwshang requested a review from Copilot April 20, 2026 14:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ic0/ic-cdk crates to expose new “caller identity attribute” system APIs (msg_caller_info_*) and adds PocketIC-based e2e coverage for them, while also improving the PocketIC server download/pinning workflow (tag or git rev).

Changes:

  • Add raw ic0 bindings for msg_caller_info_{data,signer}_{size,copy} and publish ic0 v1.1.0.
  • Add higher-level ic_cdk::api::{msg_caller_info_data, msg_caller_info_signer} and publish ic-cdk/ic-cdk-macros v0.20.1.
  • Enhance PocketIC setup (download script + test harness) and add e2e tests using update_call_with_sender_info.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
scripts/download_pocket_ic_server.sh Switches PocketIC server resolution to use cargo metadata and supports pinning by tag or git rev; adds OS/arch detection.
ic0/src/sys.rs Adds new raw wasm imports + non-wasm stubs for msg_caller_info_*.
ic0/src/lib.rs Adds safe slice-based wrappers for msg_caller_info_* size/copy APIs.
ic0/manual_safety_comments.txt Documents safety notes for the newly-added ic0.msg_caller_info_* system APIs.
ic0/ic0.txt Adds the new system API symbols to the ic0 API definition list.
ic0/Cargo.toml Bumps ic0 crate version to 1.1.0.
ic0/CHANGELOG.md Adds 1.1.0 changelog entry for the new bindings.
ic-cdk/src/api.rs Adds high-level msg_caller_info_data() and msg_caller_info_signer() helpers.
ic-cdk/Cargo.toml Bumps ic-cdk crate version to 0.20.1.
ic-cdk/CHANGELOG.md Adds 0.20.1 changelog entry for new ic_cdk::api functions.
ic-cdk-timers/src/global_timer.rs Refactors timer “skip” logic to avoid early returns inside match arms.
ic-cdk-macros/Cargo.toml Bumps ic-cdk-macros crate version to 0.20.1 (lockstep).
e2e-tests/tests/test_utilities.rs Updates PocketIC server cache validation to accept both tag and rev pins.
e2e-tests/tests/management_canister.rs Extends PocketIC setup to include threshold-keys subnet for signing API tests.
e2e-tests/tests/api.rs Adds e2e coverage for msg_caller_info_{data,signer} using PocketIC sender_info.
e2e-tests/src/bin/api.rs Adds canister entrypoints used by the new e2e tests for caller info APIs.
Cargo.toml Bumps workspace deps (ic0, ic-cdk, ic-cdk-macros) and updates PocketIC tag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread e2e-tests/tests/api.rs
Comment thread scripts/download_pocket_ic_server.sh
@lwshang lwshang marked this pull request as ready for review April 20, 2026 14:23
@lwshang lwshang requested a review from a team as a code owner April 20, 2026 14:23
@lwshang lwshang merged commit 317f55c into main Apr 20, 2026
24 checks passed
@lwshang lwshang deleted the lwshang/SDK-2672_identity_attributes branch April 20, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants